package com.jcl.recruit.timer.resume.service;

import com.jcl.recruit.server.elastic.SearchResumeServer;
import com.jcl.recruit.wechat.logic.WechatPushLogic;
import com.jcl.recruit.wechat.utils.WechatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @ClassName RecommendResumeTaskService

 * @Author yyliu
 * @Date 2018/10/30 15:35
 * @Version 1.0
 **/
@Service
public class RecommendResumeTaskService {

    @Autowired
    private WechatPushLogic wechatPushLogic;

    @Autowired
    private SearchResumeServer searchResumeServer;

    public int sendMessageTask() {
        return wechatPushLogic.pushRecommendMessage(WechatUtils.getAccessToken());
    }

    public int pushDataTask() {
        List<Map<String, String>> list = searchResumeServer.getCountBySources(true);
        return wechatPushLogic.pushRecommendMessage(list, WechatUtils.getAccessToken());
    }

}
